package com.gang.mars.basic.parseannotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

/**
 * @Author：gang.chen
 * @Date：2023/5/5 13:12
 */
@GSpringBootApplication(scanBasePackages = {"com.gang.mars.basic"})
public class GangSpringbootApplication {

    public static void main(String[] args) {
        parser(GangSpringbootApplication.class, GComponentScan.class);
    }

    public static void parser(Class<?> primarySource, Class<?> parserAnnotation)
    {
        /**
         * GSpringBootApplication 注解解析
         * */
        Annotation[] annotations = getDeclaredAnnotations(primarySource);

        GAnnotationTypeMappings mappings = new GAnnotationTypeMappings(annotations[0].annotationType());
    }

    /**
     * 返回主类上的注解
     * */
    public static Annotation[] getDeclaredAnnotations(AnnotatedElement source)
    {
        return source.getDeclaredAnnotations();
    }
}
